<template>
  <div class="count">
    <h2>Count组件</h2>
    <button @click="$emit('click',2)">自定义函数累加</button>
  </div>
</template>

<script lang="ts">
import {defineComponent} from "vue";

export default defineComponent({
  name: "Count",
});

</script>

<script lang="ts" setup>
defineEmits<{
  (event: 'click', n: number): void
}>()
</script>

<style scoped>
.count {
  background-color: pink;
}
</style>